<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /* 父元素不设置高度，子元素float，父元素的高度会坍塌  */
        /* 如何让父元素重新获取高度
        1.给父元素 overflow:hidden;  
        2.给父元素公共样式row 
          .row:after{
            content:"";
            diplay:table;
            clear:both;
        */
    .parent{
        width: 400px;
        background: salmon;
      /*  overflow: hidden;*/  
    }
    .child{
        width: 200px;
        height: 200px;
        background: yellowgreen;
        float:left;
    }
    .two{
        width: 400px;
        height: 400px;
        background: palegoldenrod;
    }
   /* .three{
        clear: both;
    } */
    .row:after{
        content:"";
        display: table;
        clear: both;
    } 
    </style>
</head>
<body>
    <div class="parent">
        <div class="child"></div>
        
    </div>
    <div class="row:fter"></div>
  <!--  <div class="two"></div>  -->
</body>
</html>